package org.spider.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author lzy
 * @since 2022-06-02 15:36:46
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("spider_config_rule")
@ApiModel(value = "SpiderConfigRuleEntity对象", description = "")
public class SpiderConfigRuleEntity extends Model<SpiderConfigRuleEntity> {

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("规则类型，1：站点规则；2：频道规则；3：文章规则；4：评论规则")
    @TableField("rule_type")
    private Integer ruleType;

    @ApiModelProperty("规则配置")
    @TableField("rule_config")
    private String ruleConfig;

    @ApiModelProperty("规则状态，1：未启用；2：正常运行；3：规则失效")
    @TableField("rule_status")
    private Integer ruleStatus;

    @ApiModelProperty("规则来源，1：配置生成；2：采集过程中产生")
    @TableField("rule_source")
    private Integer ruleSource;

    @ApiModelProperty("规则测试样例链接")
    @TableField("rule_demo_url")
    private String ruleDemoUrl;

    @ApiModelProperty("关联负责人id")
    @TableField("rule_manager_id")
    private Long ruleManagerId;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
